<?php 
namespace app\admin\controller;

use think\Controller;
use app\model\Cash;
use think\Session;

class Cashdo extends Controller{

	// 获取待审核列表
	public function getUnauditedCashList(){
		$cashs = Cash::getListByPage(10);
		$this->assign("cashs",$cashs);
		return $this->fetch();
	}

	// 获取已审核列表
	public function getAuditedCashList(){
		$cashs = Cash::getPassByPage(10);
		$this->assign("cashs",$cashs);
		return $this->fetch();
	}

	// 撤销审核
	public function removeCash(){
		$cash = Cash::get(input("cash_id"));
		$cash->is_delete = 1;
		$cash->save();
		return getResponse(0,$cash);
	}

	// 确认审核
	public function checkCash(){
		$cash = Cash::get(input("cash_id"));
		$cash->is_pass = 1;
		$cash->admin_id = session::get("admin_id");
		$cash->gmt_pass = date("Y-m-d h:i:s",time());
		$cash->save();
		return getResponse(0,$cash);
	}
}

?>